package com.example.jdbc.config;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/8/3 16:36
 * @Version 1.0.0
 * @Description
 *
 * OtherFunctionGetBean.xxx
 **/
@Configuration
public class OtherFunctionGetBean implements ApplicationContextAware {

    public static ApplicationContext yuwang;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        yuwang = applicationContext;
    }

    public static Object buyu(String fish){
        return yuwang.getBean(fish);
    }
}
